﻿-- =============================================
-- Author:		GMH
-- Create date: 
-- Description:	
-- =============================================
CREATE PROCEDURE spObtenPaquete
	@pnIdLaboratorio	INT,
	@pnIdPaquete		INT
AS
BEGIN
	SET NOCOUNT ON;

    SELECT	IdLaboratorio ,
            IdPaquete ,
            Descripcion,
            Precio
    FROM	dbo.PaqueteEstudio
    WHERE	IdLaboratorio	= @pnIdLaboratorio
    AND		IdPaquete		= @pnIdPaquete
    
    SELECT	pd.IdPaquete ,
            pd.IdLaboratorio ,
            pd.IdEstudio,
            e.NombreEstudio
    FROM	dbo.PaqueteEstudioDet		pd
    INNER JOIN dbo.CatEstudio			e
    ON		pd.IdLaboratorio	= e.IdLaboratorio
    AND		pd.IdEstudio		= e.IdEstudio
    AND		e.BajaLogica		= 0
    WHERE	pd.IdLaboratorio	= @pnIdLaboratorio
    AND		pd.IdPaquete		= @pnIdPaquete
	
	SET NOCOUNT OFF;
END